
#include <cassert>
#include <iostream>
#include <unordered_map>
using namespace std;

struct Key {
  int first;
  int second;

  bool operator==(const Key &rhs) const {
    return first == rhs.first && second == rhs.second;
  }
};

struct KeyHash {
  int operator()(const Key &k) const { return k.first; }
};

struct KeyEqual {
  bool operator()(const Key &lhs, const Key &rhs) const {
    return lhs.first == rhs.first && lhs.second == lhs.second;
  }
};

int main() {
  unordered_map<int, int> a(5);
  cout << a.size() << endl;
  cout << a.bucket_count() << endl;
  unordered_map<int, int> b(0);
  cout << b.size() << endl;
  cout << b.bucket_count() << endl;

  unordered_map<int, int> c = std::move(unordered_map<int, int>());
  cout << c.size() << endl;
  cout << c.bucket_count() << endl;

  unordered_map<Key, int, KeyHash, KeyEqual> mp(5);
  Key m1{1, 1}, m2{2, 2}, m3{3, 3};
  mp[m1] = 1;
  mp[m2] = 2;
  mp[m3] = 3;
  cout << endl;
  cout << mp[m2] << endl;

  const int num = 20;
  for (int i = 0; i < num; ++i)
    a[i] = i;
  cout << "------------------------------" << endl;
  for (auto iter = a.begin(); iter != a.end(); ++iter)
    cout << iter->second << endl;
  return 0;
}